package com.cndw.kungfu.domain;

import com.cndw.kungfu.ext.StringProcesser;
import com.cndw.kungfu.vo.SkillModeVO;
import com.cndw.kungfu.vo.battlevo.BattleSkillVO;

/**
 * 系统技能模型
 * 
 * @author fantadust
 * @date 2011-5-4 下午04:56:21
 */
public class SkillMode {
	/**
	 * 编号
	 */
	private int id;
	/**
	 * 职业id
	 */
	private int vocationId;
	/**
	 * 名称
	 */
	private String name;
	/**
	 * 副名称
	 */
	private String deputyName;
	/**
	 * 技能根id
	 */
	private int skillLibId;
	/**
	 * 技能类型
	 */
	private int type;
	/**
	 * 技能图片
	 */
	private String icon;
	/**
	 * 技能等级
	 */
	private int level;
	/**
	 * 玩家等级要求
	 */
	private int playerLevel;
	/**
	 * 前置技能id
	 */
	private int frontSkillId;
	/**
	 * 学习需要使用技能书
	 */
	private int studyBookId;
	/**
	 * 升级需要银两
	 */
	private int asset;
	/**
	 * 学习需要金币
	 */
	private int gold;
	/**
	 * 升级需要的石头个数
	 */
	private int stoneNum;
	/**
	 * 升级需要的花费时间
	 */
	private int costTime;
	/**
	 * 描述
	 */
	private String description;
	/**
	 * 是否群攻
	 */
	private boolean groupType;
	/**
	 * 攻击个数
	 */
	private int groupNum;
	/**
	 * 是否仅在战斗中使用
	 */
	private boolean onlyBattleUse;
	/**
	 * 目标类型 1=>'敌方',2=>'友方'
	 */
	private int targetType;
	/**
	 * 被动技能提升类型
	 */
	private int passiveType;
	/**
	 * 被动技能提升属性值
	 */
	private int passiveValue;
	/**
	 * 被动技能加成追加
	 */
	private String passiveAdd;
	/**
	 * 伤害
	 */
	private int effectValue;

	/**
	 * 冷却时间 毫秒
	 */
	private int coolingTime;
	/**
	 * 消耗魔法量
	 */
	private int constMp;
	/**
	 * 吟唱时间 毫秒
	 */
	private int singingTime;
	/**
	 * 触发buff的几率
	 */
	private int buffRate;	
	/**
	 * 可触发的buff根id
	 */
	private int buffId;
	/**
	 * 技能动作
	 */
	private String actionIds;
	/**
	 * 动作播放时间
	 */
	private int playTime;

	private int[] passiveAdds;

	/**
	 * 职业武功
	 */
	public static final int typeVocational = 1;
	/**
	 * 气功
	 */
	public static final int typeStrength = 2;
	/**
	 * 秘籍
	 */
	public static final int typeCheats = 4;
	
	public static final int typeMartial = 8;
	
	public static final int typeMonster = 32;
	
	public static final int typePet = 64;

	private SkillModeVO skillModeVO;
	private BattleSkillVO battleSkillVO;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getVocationId() {
		return vocationId;
	}

	public void setVocationId(int vocationId) {
		this.vocationId = vocationId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDeputyName() {
		return deputyName;
	}

	public void setDeputyName(String deputyName) {
		this.deputyName = deputyName;
	}

	public int getSkillLibId() {
		return skillLibId;
	}

	public void setSkillLibId(int skillLibId) {
		this.skillLibId = skillLibId;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public int getPlayerLevel() {
		return playerLevel;
	}

	public void setPlayerLevel(int playerLevel) {
		this.playerLevel = playerLevel;
	}

	public int getFrontSkillId() {
		return frontSkillId;
	}

	public void setFrontSkillId(int frontSkillId) {
		this.frontSkillId = frontSkillId;
	}

	public int getStudyBookId() {
		return studyBookId;
	}

	public void setStudyBookId(int studyBookId) {
		this.studyBookId = studyBookId;
	}

	public int getAsset() {
		return asset;
	}

	public void setAsset(int asset) {
		this.asset = asset;
	}

	public int getStoneNum() {
		return stoneNum;
	}

	public void setStoneNum(int stoneNum) {
		this.stoneNum = stoneNum;
	}

	public int getGold() {
		return gold;
	}

	public void setGold(int gold) {
		this.gold = gold;
	}

	public int getCostTime() {
		return costTime;
	}

	public void setCostTime(int costTime) {
		this.costTime = costTime;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public boolean isGroupType() {
		return groupType;
	}

	public void setGroupType(boolean groupType) {
		this.groupType = groupType;
	}

	public boolean isOnlyBattleUse() {
		return onlyBattleUse;
	}

	public void setOnlyBattleUse(boolean onlyBattleUse) {
		this.onlyBattleUse = onlyBattleUse;
	}

	public int getTargetType() {
		return targetType;
	}

	public void setTargetType(int targetType) {
		this.targetType = targetType;
	}

	public int getPassiveType() {
		return passiveType;
	}

	public void setPassiveType(int passiveType) {
		this.passiveType = passiveType;
	}

	public int getPassiveValue() {
		return passiveValue;
	}

	public void setPassiveValue(int passiveValue) {
		this.passiveValue = passiveValue;
	}

	public int getEffectValue() {
		return effectValue;
	}

	public void setEffectValue(int effectValue) {
		this.effectValue = effectValue;
	}

	public int getCoolingTime() {
		return coolingTime;
	}

	public void setCoolingTime(int coolingTime) {
		this.coolingTime = coolingTime;
	}

	public int getConstMp() {
		return constMp;
	}

	public void setConstMp(int constMp) {
		this.constMp = constMp;
	}

	public int getSingingTime() {
		return singingTime;
	}

	public void setSingingTime(int singingTime) {
		this.singingTime = singingTime;
	}

	public int getBuffId() {
		return buffId;
	}

	public void setBuffId(int buffId) {
		this.buffId = buffId;
	}

	public String getActionIds() {
		return actionIds;
	}

	public void setActionIds(String actionIds) {
		this.actionIds = actionIds;
	}

	public int getPlayTime() {
		return playTime;
	}

	public void setPlayTime(int playTime) {
		this.playTime = playTime;
	}

	public int[] getPassiveAdds() {
		return passiveAdds;
	}

	public String getPassiveAdd() {
		return passiveAdd;
	}

	public void setPassiveAdd(String passiveAdd) {
		this.passiveAdd = passiveAdd;
		if (passiveAdd != null && passiveAdd.length() > 9) {
			try {
				passiveAdds = StringProcesser.toIntArray(passiveAdd);
			} catch (Exception e) {
				e.printStackTrace();
			}
			
		}
	}

	public int getGroupNum() {
		return groupNum;
	}

	public void setGroupNum(int groupNum) {
		this.groupNum = groupNum;
	}

	public int getBuffRate() {
		return buffRate;
	}

	public void setBuffRate(int buffRate) {
		this.buffRate = buffRate;
	}

	public SkillModeVO toSkillModeVO() {
		if (skillModeVO == null) {
			skillModeVO = new SkillModeVO(this);
		}
		return skillModeVO;
	}

	public BattleSkillVO toBattleSkillVO() {
		if (battleSkillVO == null) {
			battleSkillVO = new BattleSkillVO(this);
		}
		return battleSkillVO;
	}

}
